package cn.ruituo.adv5;
import java.io.*;
public class DaTaInAndOut {
    public static void main(String[] args) {
        try {
//            DataOutputStream dout=new DataOutputStream(new FileOutputStream("E:\\temp\\java72\\advance\\1.data"));
//            dout.writeInt(21016);//4
//            dout.writeByte(65);//1
//            dout.writeDouble(Math.PI);//8
//            dout.writeBoolean(2>1);//1
//            dout.writeBoolean(4>56);//1
//            dout.writeFloat(24.6F);//4
//            //dout.writeUTF("We change lives!");
//            dout.close();
            ///////////////////
            DataInputStream din=new DataInputStream(new FileInputStream("E:\\temp\\java72\\advance\\1.data"));
            int k=din.readInt();
            System.out.println(k);
            byte b=din.readByte();
            System.out.println(b);
            double dd=din.readDouble();
            System.out.println(dd);
            boolean b1=din.readBoolean();
            boolean b2=din.readBoolean();
            System.out.println(b1+","+b2);
            float f=din.readFloat();
            System.out.println(f);
            din.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        // DataInputStream din=new DataInputStream(new FileInputStream(""))
    }
}
